﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="expires" content="0">
<meta http-equiv="cache-control" content="no-cache">
<script type="text/javascript" src="js/scriptaculous/lib/prototype.js"></script> 
<script type="text/javascript" src="js/scriptaculous/src/scriptaculous.js"></script>
<script type="text/javascript" src="js/c2t.js"></script>
<link rel="stylesheet" type="text/css" href="css/style.css" />
</head>

 
<?php $id=$_GET['id']; echo "<script type='text/javascript'>var identificador='".$id."';</script>";?>

<?php

//these values should be provided from a dabatase. This is only an example
$linea1='CLICK 2 TALK';
$linea2='From here you can call the pyme to ask for information';
$linea3;
$linea4;
$background_color='green';
$text_color='white';
$sip_uri='sip:pyme@domain.dom';
$display_name='Pyme Name';
$idremitente=1;
$diferida=1;
$idremitente_en=1;
$diferida_en=1;
$tmax=20;

echo "<script type='text/javascript'>var pymeURI='".$sip_uri."';</script>";

echo "<script type='text/javascript'>var diferida_en='".$diferida_en."';</script>";

echo "<script type='text/javascript'>var tmax='".$tmax."';</script>";

?>


<body onload="initWindow()" style="background-color:<?php echo $background_color;?>;color:<?php echo $text_color;?>; ">

<center>
<div id="contenedor" class="contenedor" style="background-color:<?php echo $background_color;?>;color:<?php echo $text_color;?>; ">
<div id="logo" class="logo"><img src="images/<?php echo $id;?>logo.gif"></div>
<div id="mensaje" class="mensaje">
<center>
<?php echo $linea1;?><br>
<?php echo $linea2;?><br>
<?php echo $linea3;?><br>
<?php echo $linea4;?><br>
</center>
</div>

<div id="dinamico" class="dinamico">
			
			<div id="numtel" class="numtel"  style="display:none;" >	      
					<div id="uri_sip_div" style="height:20px;"><input style="float:right;display:inline;margin-right:45px;width:220px;" type="text" size="30" maxlength="30" value="" id="sipuri"><span style="float:right;display:inline;margin-right:3px;" >Your phone nr:</span></div>
				   <div id="display_name_div" style="margin-top:3px;height:20px;" ><input type="text" style="float:right;display:inline;margin-right:45px;width:220px;" size="30" maxlength="30" id="display_name"><span style="float:right;display:inline;margin-right:3px;">Your name(op):</span> </div>
					<?php
					if ($idremitente==1 && $idremitente_en==1) echo   "<div style='margin-top:10px;margin-left:160px;width:120px;' style='float:left;display:inline;'>Hide my identity:<input type='checkbox' checked name='ocultarid' id='ocultarid'></div>";
			      else echo "<div style='margin-top:10px;' style='float:left;display:inline;'><input type='hidden' name='ocultarid' id='ocultarid' value='1'><center>Your identity will not be revealed</center></div>";
				   ?> 	
  			<div id="presence" class="presence" style="width:400px;">
				<div id="presence_avatar" style="margin-right:210px;margin-top:15px;">
					<div id="img_presence_disponible"  style="display:none;"><img  src="images/disponible.png" style="float:right"></div>
					<div id="img_presence_ocupado" style="display:none;"><img  src="images/ocupado.png" style="float:right;";></div>
					<div id="img_presence_undefined"><img  src="images/undefined.png" style="float:right;";></div>
			   </div>			   
			</div>	   
		  		   <div style="margin-top:55px;"><center><img src="images/loader.gif" width="32" height="32" border="0" alt="" id="loader" style="display:none;margin-top:-2px;"><input type="button" onclick="llamar();" value="Call" id="boton_llamada"></center></div>      		            
			</div>
			
			<div id="calldeferred" class="calldeferred">		
			<div style="height:20px;"><input style="float:right;display:inline;margin-right:30px;width:220px;" type="text" size="30" maxlength="30" value="" id="sipuri_d"><span style="float:right;display:inline;margin-left:3px;" >Your phone nr:</span></div>
		   <div style="margin-top:3px;height:20px;"><input type="text" style="float:right;display:inline;margin-right:30px;width:220px;" size="30" maxlength="30" id="display_name_d"><span style="float:right;display:inline;margin-left:3px;" >Your name(op):</span> </div>
			
			<?php
			if ($idremitente==1 && $idremitente_en==1) echo   "<div style='margin-top:10px;margin-left:160px;width:120px' style='float:left;display:inline;'>Hide my identity:<input type='checkbox' checked name='ocultarid_d' id='ocultarid_d'></div>";
	      else echo "<div style='margin-top:10px;' style='float:left;display:inline;'><center>Your identity will not be revealed</center><input type='hidden' value='1' name='ocultarid_d' id='ocultarid_d'></div>";
		   ?>
		   
		   <div id="wrapper_presence" style="width:400px;height:40px">
						<div id="presence" class="presence">
							<div id="presence_avatar">
								<div id="img_presence_disponible_deferred" style="display:none;"><img  src="images/disponible.png" style="float:right"></div>
								<div id="img_presence_ocupado_deferred" style="display:none;"><img  src="images/ocupado.png" style="float:right;";></div>
								<div id="img_presence_undefined_deferred"><img  src="images/undefined.png" style="float:right;";></div>
						   </div>
						</div>
			      	<div style='margin-top:16px;'>
						        	<span id="marcador" style="float:left; display: inline; margin-left:5px;width:100px;"> </span>
									<input type="hidden" name="tdelay" value="0" id="tdelay">
												  <div id="slider_bar" class="slider_bar">
												    <div id="slider" class="slider"> </div>
												  </div>		         		            									  
						</div>			  
						<div style="margin-top:8px;"><center><img src="images/loader.gif" width="32" height="32" border="0" alt="" id="loader_deferred" style="display:none;margin-top:-10px;"><input type="button" style="width:40px;height:20px;float:left;display:inline;margin-left:15px;" onclick="llamar();" value="OK" id="boton_llamada_deferred"></center></div>
			</div>	
				
				<script type="text/javascript">
			      $('marcador').innerHTML='Call now';
			      var slider = new Control.Slider('slider','slider_bar',{
			      range:$R(0,<?php echo $tmax;?>), 
			      sliderValue:0,
          	     	      onSlide:function(v){w=v.toFixed();if (w==0){$('marcador').innerHTML='Call now';}else {$('marcador').innerHTML='Call after '+w+' minutes ';}},
                          onChange:function(v){w=v.toFixed();if (w==0){$('marcador').innerHTML='Call now';}else {$('marcador').innerHTML='Call after '+w+' minutes ';} $('tdelay').value=w}});
			      $('calldeferred').hide();
			      $('numtel').show();      
				</script>	
				
			</div>
			
			<center><div id="msg_ocup" style="display:none;"></div></center>
				
			<div id="callinfo" class="callinfo" style="display:none;">
				<div id="cuentatras" class="cuentatras">			
					<div id="countdowncontainer"></div>	
				</div>					

				<div id="presenceinfo" style="float:left;width:50px;height:40px;margin-top:20px;margin-left:40px;">
					<div id="presence_avatarinfo">
						<div id="presence_disponible" style="display:none;"><img  src="images/disponible.png" style="float:right"></div>
						<div id="presence_ocupado" style="display:none;"><img  src="images/ocupado.png" style="float:right;";></div>
						<div id="presence_undefined"><img  src="images/undefined.png" style="float:right;";></div>
				   </div>
				</div>				
				
				<div id="msginfo" class="msginfo">			
					<span id="msgtext"></span>	
				</div>		
						
				<div style="margin-top:1px;" id="terminar"><input type="button" onclick="jsendCall();" style="height:20px" value="End Call"></div>
			</div>

			<div id="aviso" class="aviso" style="display:none;">
			
			</div>
				
</div>

<div id="powered" class="powered"><img id="img_powered" src="images/powered.png"></div>

</div>
</center>

</body>
